﻿using JzSport.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace JzSport.WebApp.Init
{
    public partial class InitPromotionalActivity : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void _ctlBtnCreate_Click(object sender, EventArgs e)
        {
            string[] paaidrr = new string[]{
                "{D29586A7-0222-4D9B-AFD6-9D6AFFBD7B3D}",
                "{25DBCB39-EF28-47FD-9AC3-3704859E0298}",
                "{9E984864-41A8-49CC-9A61-3530BF32A85C}"
            };
            string[] paarr = new string[]{
                "./Res/badminton_min.jpg",
                "./Res/basketball_min.jpg",
                "./Res/football_min.jpg"
            };
            string[] paalinkrr = new string[]{
                "./HTML/Prompt_1.html",
                "./HTML/Prompt_1.html",
                "./HTML/Prompt_1.html"
            };
            for (int index = 0; index < paaidrr.Length; index++)
            {
                PromotionalActivity item = new PromotionalActivity();
                item.Id = Guid.NewGuid();
                item.City = _ctlEdtiCity.Text;
                item.Title = string.Format("推广活动-{0}", index);
                item.CreatedTime = DateTime.Now;
                item.BeginTime = DateTime.Now;
                item.EndTime = DateTime.Now.AddDays(1);
                item.IsDeleted = false;
                item.PreviewImageUrl = string.Format("{0}{1}", Configs.BaseWebUrl, paarr[index]);
                item.LinkUrl = string.Format("{0}{1}", Configs.BaseWebUrl, paalinkrr[index]);
                new PromotionalActivityService().Create(item);
                Response.Write(string.Format("<b>创建PromotionalActivity,code:{0},caption:{1}</b><br/>", paarr[index], paalinkrr[index]));
            }
        }
    }
}